home *** CD-ROM | disk | FTP | other *** search
- Path: news.compuserve.com!newsmaster
- From: <artb@uc.mhs.compuserve.com>
- Newsgroups: comp.lang.c
- Subject: Serial Communications in C
- Date: 2 Feb 1996 19:20:09 GMT
- Organization: CompuServe Incorporated
- Message-ID: <4eto59$ht7@dub-news-svc-3.compuserve.com>
- NNTP-Posting-Host: dd62-151.compuserve.com
- Content-Type: text/plain
- Keywords: Serial Communications C
- Content-length: 1324
- X-Newsreader: AIR Mosaic (16-bit) version 3.10.08.25
-
-
- David,
-
- I use MSVC 1.2 with serial communications. The following function is available there:
-
- _bios_serialcom
-
- #include <bios.h>
-
- Syntax unsigned _bios_serialcom( unsigned service, unsigned serial_port, unsigned data );
-
- Parameter Description
- service Communications service
- serial_port Serial port to use
- data Port configuration bits
- The _bios_serialcom routine uses INT 0x14 to provide serial communications services. The serial_port parameter is set to 0 for
- COM1, to 1 for COM2, and so on.
- The _bios_serialcom routine may not be able to establish reliable communications at baud rates in excess of 1,200 baud
- (_COM_1200) due to the overhead associated with servicing computer interrupts. Faster data communication rates are possible
- with more direct programming of serial-port controllers. See C Programmer's Guide to Serial Communications for more details on
- serial-communications programming in C.
-
- The service parameter can be set to one of the following manifest constants:
-
- _COM_INIT
-
- Sets the port to the parameters specified in the data parameter
-
- _COM_SEND
-
- Transmits the data characters over the selected serial port
-
- _COM_RECEIVE
-
- Accepts an input character from the selected serial port
-
- _COM_STATUS
-
- Returns the current status of the selected serial port
-
-
-